function newInstanceof(c, p) {
    c = c.__proto__;
    while (true) {
        if (c === null) return false;
        if (c === p.prototype) return true;
        c = c.__proto__;
    }
}

console.log(newInstanceof([], Array))
console.log(newInstanceof({}, Object))
console.log(newInstanceof([], Object))
console.log(newInstanceof(1, String))